//
//  UserInfoService.h
//  HZHome
//
//  Created by SunShine on 13-10-14.
//  Copyright (c) 2013年 xzysun. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "MKNetworkKit.h"
#import "UserCustomInfo.h"
#import "UserInfo.h"

@protocol UserInfoDataDelegate;

/**
 *	@brief	用户信息相关服务
 */
@interface UserInfoService : NSObject

{
    
}
@property (weak, nonatomic) id<UserInfoDataDelegate> delegate;
@property (strong, nonatomic) NSString *currentLoginUserName;
@property (strong, nonatomic) UserCustomInfo *userCustomInfo;
@property (strong, nonatomic) UserInfo *userInfo;
@property (strong, nonatomic) NSString *lastLoginPassword;
@property (nonatomic, strong) NSTimer *postTimer;
+(UserInfoService *)getUserInfoService;
-(void)customiezStreetWithStreetId:(NSString *)streetId;
-(void)checkUserLoginWithName:(NSString *)userName andPassword:(NSString *)password;
-(void)checkUserLoginWithImdeiCode:(NSString *) imeiCode;
-(void)modifyUserInfoWithMobile:(NSString *)mobile Address:(NSString *)address StreetId:(NSInteger)streedId Permanent:(bool)permanent WorkHere:(BOOL)workHere;
-(void)modifyUserPassword:(NSString *)password;
-(void)checkUsrMobile:(NSString *)mobile;
-(void)userFeedbackWithContent:(NSString *)content Practicality:(NSInteger)practicality EaseUse:(NSInteger)easeUse;
-(void)loginSuccessHandler:(id)json;
-(void)logout;
//- (void)doPostServerTimer:(NSTimer *)mTimer;
-(void)addUserWithName:(NSString *)name Password:(NSString *)password Phone:(NSString *)phone Address:(NSString *)address StreetId:(NSInteger)streetId LiveHere:(BOOL)liveHere WorkHere:(BOOL)workHere;
-(void)autoLogin;

//查询手机验证码
-(void)getPhoneCheckNumber:(NSString *)mobile Success:(void (^)(NSDictionary *data))success Failure:(void (^)(NSString *msg))failure;
//验证手机号码和验证码是否正确
-(void)valiNum:(NSString *)mobile checkNumber:(NSString *)num Success:(void (^)(NSDictionary *data))success Failure:(void (^)(NSString *msg))failure;

//注册用户2 有回调
-(void)addUser:(NSString *)name Password:(NSString *)password Phone:(NSString *)phone Address:(NSString *)address StreetId:(NSInteger)streetId LiveHere:(BOOL)liveHere WorkHere:(BOOL)workHere Success:(void (^)(NSDictionary *data))success Failure:(void (^)(NSString *msg))failure;

@end

@protocol UserInfoDataDelegate <NSObject>

-(void)loadUserInfoFinished:(id)result;
-(void)loadUserInfoFaild:(NSString*)msg;
@end